<template>
	<view class="content">
		<view class="">
			<button type="primary" @click="toReturn(1)">测试1</button>
		</view>
		<view class="">
			<button type="primary" @click="toReturn(2)">测试2</button>
		</view>
		<view class="">
			<button type="primary" @click="toReturn(3)">测试3</button>
		</view>
		<view class="text-view">
			id:<text @click="paste(info.id)">{{info.id}}</text>
		</view>
		<view class="text-view">
			token:<text @click="paste(info.token)">{{info.token}}</text>
		</view>
		<view class="text-view">
			clientid:<text @click="paste(info.clientid)">{{info.clientid}}</text>
		</view>
		<view class="text-view">
			appid:<text @click="paste(info.appid)">{{info.appid}}</text>
		</view>
		<view class="text-view">
			appkey:<text @click="paste(info.appkey)">{{info.appkey}}</text>
		</view>
		<view class="text-view">
			当前版本<text>1</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '主页',
				info: ''
			}
		},
		onLoad() {
			var info = plus.push.getClientInfo();
			this.info = info
			
			if(null == uni.getStorageSync('clientid')){
				
				return;
			}else{
				//发送cid
				uni.request({
					url: "http://192.168.0.31:10080/appGt/appCid",
					method: 'GET',
					header: {
						'Content-Type': 'application/json;charset=UTF-8',
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: {"cid":uni.getStorageSync('clientid')},
					dataType: 'json',
					success: function(data) {
						console.log('-------request----ok----')
						console.log(data)
						if (data.statusCode == '200') {
						}else{
				
						}
					},
					fail: function(error) {
						console.log('-------request----error----')
						
					}
				})
			}

		

		},
		methods: {
			toReturn(index) {
				uni.navigateTo({
					url: 'test' + index
				})
			},
			paste(value) {
				uni.setClipboardData({
					data: value
				});
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.text-view {
		text-align: left;
		font-size: small;
		margin-top: 30rpx;
	}
</style>
